<template>
  <div>
    <view v-if="deliveryString === ORDER_DELIVER_METHOD.PUB_LOCAL">
      <view
        v-if="
          status === ORDER_STATUS.UNDERWAY &&
          subStatusInt === ORDER_PUB_LOCAL_STATUS.WAITING_SEND
        "
      >
        未配送
      </view>
      <view
        v-else-if="
          status === ORDER_STATUS.UNDERWAY &&
          subStatusInt === ORDER_PUB_LOCAL_STATUS.SENDING
        "
      >
        配送中
      </view>
      <view v-else>
        <text v-if="status === ORDER_STATUS.CANCEL && isHasRefund">已退款</text>
        <text v-else>{{ ORDER_STATUS_TEXT[status] }}</text>
      </view>
    </view>
    <view v-else>
      <text v-if="status === ORDER_STATUS.CANCEL && isHasRefund">已退款</text>
      <text v-else>{{ ORDER_STATUS_TEXT[status] }}</text>
    </view>
  </div>
</template>

<script>
import {
  ORDER_DELIVER_METHOD,
  ORDER_PUB_LOCAL_STATUS,
  ORDER_STATUS,
  ORDER_STATUS_TEXT,
} from "@/pages/sp-order/const/order";

export default {
  props: {
    status: [String],
    deliveryString: [String],
    subStatusInt: [String, Number],
    isHasRefund: [Boolean],
  },
  data() {
    return {
      ORDER_STATUS_TEXT,
      ORDER_PUB_LOCAL_STATUS,
      ORDER_STATUS,
      ORDER_DELIVER_METHOD,
    };
  },
};
</script>

<style scoped></style>
